<?php
/**
 * Created by PhpStorm.
 * User: admin
 * Date: 2019/6/6
 * Time: 9:37
 */

namespace app\admin\controller;


use app\admin\model\CommonInfo;

class About extends Base
{

    public function lists(){
        $data = CommonInfo::where('id',1)->find();
        $this->assign('data',$data);
        return $this->fetch();
    }

    public function save(){
        $post = input('post.');
        $data = [
            'about'=>$post['content'],
        ];
        $ret = CommonInfo::update($data,['id'=>1]);
        if (!$ret){
            return json(['code'=>0,'msg'=>'保存失败']);
        }
        return json(['code'=>1,'msg'=>'保存成功']);
    }


}